package API.JDBC.d1104;

import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Spinner;

public class MyDialog extends Dialog {

	protected Object result;
	protected Shell shell;
	private Text text;
	private Text text_1;

	/**
	 * Create the dialog.
	 * @param parent
	 * @param style
	 */
	public MyDialog(Shell parent, int style) {
		super(parent, style);
		setText("SWT Dialog");
	}

	/**
	 * Open the dialog.
	 * @return the result
	 */
	public Object open() {
		createContents();
		shell.open();
		shell.layout();
		Display display = getParent().getDisplay();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	private void createContents() {
		shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
		shell.setSize(370, 423);
		shell.setText("个人信息");
		
		Label label = new Label(shell, SWT.NONE);
		label.setBounds(41, 27, 61, 17);
		label.setText("用户名");
		
		text = new Text(shell, SWT.BORDER);
		text.setBounds(129, 21, 131, 23);
		
		Label label_1 = new Label(shell, SWT.NONE);
		label_1.setBounds(41, 73, 61, 17);
		label_1.setText("密码");
		
		text_1 = new Text(shell, SWT.BORDER | SWT.PASSWORD);
		text_1.setBounds(129, 67, 131, 23);
		
		Label label_2 = new Label(shell, SWT.NONE);
		label_2.setBounds(41, 128, 61, 17);
		label_2.setText("学历：");
		
		Button button = new Button(shell, SWT.RADIO);
		button.setBounds(102, 128, 45, 17);
		button.setText("高中");
		
		Button button_1 = new Button(shell, SWT.RADIO);
		button_1.setBounds(158, 128, 45, 17);
		button_1.setText("专科");
		
		Button button_2 = new Button(shell, SWT.RADIO);
		button_2.setBounds(219, 128, 45, 17);
		button_2.setText("本科");
		
		Button button_3 = new Button(shell, SWT.CHECK);
		button_3.setBounds(102, 174, 69, 17);
		button_3.setText("读书沙龙");
		
		Button button_4 = new Button(shell, SWT.CHECK);
		button_4.setBounds(191, 174, 61, 17);
		button_4.setText("滑板");
		
		Button button_5 = new Button(shell, SWT.CHECK);
		button_5.setBounds(272, 174, 61, 17);
		button_5.setText("游戏");
		
		Label label_3 = new Label(shell, SWT.NONE);
		label_3.setBounds(41, 174, 61, 17);
		label_3.setText("社团");
		
		Label label_4 = new Label(shell, SWT.NONE);
		label_4.setBounds(41, 210, 45, 17);
		label_4.setText("籍贯");
		
		Combo combo = new Combo(shell, SWT.NONE);
		combo.setItems(new String[] {"湖南", "湖北"});
		combo.setBounds(101, 207, 88, 25);
		
		Spinner spinner = new Spinner(shell, SWT.BORDER);
		spinner.setBounds(102, 265, 162, 23);
		
		Label label_5 = new Label(shell, SWT.NONE);
		label_5.setBounds(41, 268, 61, 17);
		label_5.setText("工资");
		
		Button button_6 = new Button(shell, SWT.NONE);
		button_6.setBounds(67, 336, 80, 27);
		button_6.setText("保存");
		
		Button button_7 = new Button(shell, SWT.NONE);
		button_7.setBounds(209, 336, 80, 27);
		button_7.setText("取消");

	}
}
